package com.qf.util;

import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @version : 1.0
 * @author:宋煜
 * @date: 2022/5/19 20:26
 */
@Component
public class GetTimeShort {
    public static String getTimeIncludeMinute() {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmm");
        Date currentTime = new Date();
        String dateString = formatter.format(currentTime);
        return dateString;
    }
    public static String getTimeNoMinute() {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
        Date currentTime = new Date();
        String dateString = formatter.format(currentTime);
        return dateString;
    }
    public static String getTimeShort() {
        SimpleDateFormat formatter = new SimpleDateFormat("HH.mm");
        Date currentTime = new Date();
        String dateString = formatter.format(currentTime);
        return dateString;
    }
}
